﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="WebHoiChoMuaBan.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	PostProduct
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadHolder" runat="server">
    <style type="text/css" media="screen">
			.error { font-weight: Bold; color: Red; }
	</style>
    <script type="text/javascript" src="../../Content/ckeditor/ckeditor.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#rbtProduct').click(function () {
                $('#rbtRentNeed , #lblRentNeed').hide();
                $('#rbtForRent , #lblForRent').hide();
                $('#rbtNewProject , #lblNewProject').hide();
                $('#AttributeRealEstate, #ProductType').hide();
            });

            $('#rbtRealEstate').click(function () {
                $('#rbtRentNeed , #lblRentNeed').show();
                $('#rbtForRent , #lblForRent').show();
                $('#rbtNewProject , #lblNewProject').show();
                $('#AttributeRealEstate, #ProductType').show();
            });

            //Load danh mục con
            $("#ddlCateLevel1").change(function () {
                $.ajax({
                    type: "POST",
                    url: "/PostProduct/SelectChildCategory",
                    data: "parentID=" + $(this).val(),
                    success: function (result) {
                        if (result.success) {
                            $("#ddlCateLevel2").empty();
                            $.each(result.data, function (index, optionData) {
                                $("#ddlCateLevel2").append("<option value='" + optionData.Value + "'>" + optionData.Text + "</option>");
                            });
                        }
                    },
                    error: function (req, status, error) {
                        alert("Sorry! We could not receive your feedback at this time.");
                    }
                });
            });
        });

        window.onload = function () {
            CKEDITOR.replace('PostContent',
            {
                toolbar:
                [
                // Your toolbaar configuration here. but make sure that
                // 'Image' is available.

                    ['Source'],
                    ['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
                    ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley'],
                    ['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll'],
                ],
                filebrowserImageBrowseUrl: '/Upload/Index',
                height: 300,
                ignoreEmptyParagraph: true,
                htmlEncodeOutput: true
            });
        };

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="hoicho_content_maingroup">
        <!-- Content right -->
        <div class="col_left hoicho_marin_leftright content_right">
            <div class="content_group">
                <div class="col_left content_group hoicho_margin_topbottom">
                    <div class="private_button_upload col_left">
                        <a href="photo_dangtai_private.html"><img src="../../Content/Images/icon_plus_up.gif">
                        Đăng sản phẩm</a>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="private_group_friend">
                <%=Html.ValidationSummary("Vui lòng nhập đầy đủ thông tin.", new { @class= "error"})%>
                <form action="<%= Url.Action("Index","PostProduct") %>" method="post" enctype="multipart/form-data">
                <table width="100%" border="0">
                        <tr>
                            <td align="right"><span class="private_text_title">Chọn loại tin:</span>&nbsp;</td>
                            <td align="left">
                                <input type="radio" class="input_checkbox" id="rbtRealEstate" name="TypeNews" checked="checked" value="RealEstate">
                                <label class="private_text_title" for="rbtNhaDat">Đăng tin mục nhà đất</label>
                                <input type="radio" class="input_checkbox" id="rbtProduct" name="TypeNews" value="Product">
                                <label class="private_text_title" for="rbtSanPham">Đăng tin mục sản phẩm</label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right"><label for="select"></label>
                                <select style="width:255px" id="ddlCateLevel1" name="ddlCateLevel1">
                                    <%
                                        Response.Write("<option value='0'>Chọn chuyên mục chính</option>");
                                        List<Category> cates = (List<Category>)ViewData["Categories"];
                                        foreach (var cate in cates)
                                        {
                                            Response.Write("<option value='"+cate.CateId+"'>"+ cate.CateName +"</option>");
                                        }
                                    %>
                                </select>
                                <select style="width:260px" id="ddlCateLevel2" name="ddlCateLevel2">
                                    <option>Danh mục con</option>
                                </select>
                                <select style="width:185px" id="ddlProvince" name="ddlProvince">
                                    <option value='0'>Toàn quốc</option>
                                    <%
                                        foreach (var province in (List<Province>)ViewData["Provinces"])
                                        {
                                            Response.Write("<option value='"+province.ProvId+"'>" + province.ProvName + "</option>");
                                        }
                                    %>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td valign="middle" align="right" class="private_font_bold">Nhu cầu</td>
                            <td align="left">
                                <input type="radio" class="input_checkbox" id="rbtBuy" name="group2" checked="checked">
                                <label for="rbtSanPham">Cần mua</label>
                                <input type="radio" class="input_checkbox" id="rbtSell" name="group2">
                                <label for="rbtNhaDat">Cần bán</label>
                                <input type="radio" class="input_checkbox" id="rbtRentNeed" name="group2">
                                <label for="rbtRentNeed" id="lblRentNeed">Cần thuê</label>
                                <input type="radio" class="input_checkbox" id="rbtForRent" name="group2">
                                <label for="rbtForRent" id="lblForRent">Cho thuê</label>
                                <input type="radio" class="input_checkbox" id="rbtNewProject" name="group2">
                                <label for="rbtNewProject" id="lblNewProject">Dự án mới</label>
                            </td>
                        </tr>
                        <tr>
                            <td width="12%" valign="middle" align="right" class="private_font_bold">Tiêu đề</td>
                            <td width="88%"><label for="textfield"></label>
                            <input type="text" class="input_full" id="textfield" name="textfield"></td>
                        </tr>
                        <tr>
                            <td width="12%" valign="middle" align="right" class="private_font_bold">Giá bán</td>
                            <td width="88%"><label for="textfield"></label>
                            <input type="text" class="input_full" id="text1" name="textfield"></td>
                        </tr>
                        <tr>
                            <td valign="middle" align="right" class="private_font_bold">Xuất xứ</td>
                            <td><input type="text" class="input_full" id="textfield3" name="textfield3"></td>
                        </tr>
                        <tr>
                            <td valign="middle" align="right" class="private_font_bold">Hình mình họa</td>
                            <td><label for="fileField"></label>
                            <input type="file" id="fileField" name="fileField"></td>
                        </tr>
                        <tr>
                            <td valign="top" align="right" class="private_font_bold">Mô tả chung</td>
                            <td><label for="textarea"></label>
                            <textarea class="input_full" rows="5" cols="45" id="textarea" name="textarea"></textarea></td>
                        </tr>
                        <tr id="ProductType">
                            <td>&nbsp;</td>
                            <td>
                                <input type="radio" class="input_checkbox" id="rbtHotProduct" name="group3" checked="checked">
                                <label for="rbtNewProject" id="Label1">Sản phẩm HOT</label>
                                <input type="radio" class="input_checkbox" id="rbtNewProduct" name="group3">
                                <label for="rbtNewProject" id="Label2">Sản phẩm mới</label>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" align="right" class="private_font_bold">Mô tả chi tiết</td>
                            <td><textarea id="PostContent" cols="30" rows="10"></textarea></td>
                        </tr>
                        <tr id="AttributeRealEstate">
                            <td colspan='2'>
                                <table width="100%" border="0" class="private_share_post">
                                    <tr>
                                        <td colspan="3" bgcolor="#ebf3fb"><span class="private_text_title">Tiện ích</span></td>
                                    </tr>
                                    <tr>
                                        <td bgcolor="#f7fbfb"><input type="checkbox" name="checkbox2" id="checkbox2" />
                                        <label for="checkbox2">Nước máy</label></td>
                                        <td bgcolor="#f7fbfb">Diện tích sử dụng: 30m</td>
                                        <td bgcolor="#f7fbfb">Diện tích khuôn viên: 60m</td>
                                    </tr>
                                    <tr>
                                        <td bgcolor="#f7fbfb"><input type="checkbox" name="checkbox3" id="checkbox3" />
                                        Đồng hồ điện riêng</td>
                                        <td bgcolor="#f7fbfb">Số lầu:  5</td>
                                        <td bgcolor="#f7fbfb">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" bgcolor="#ebf3fb"><span class="private_text_title">Nội thất - Tiện nghi</span></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Thang máy
                                           	<label for="checkbox4"></label></td>
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Bảo vệ 24/24
                                            <label for="checkbox4"></label></td>
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Chổ đậu ô tô
                                            <label for="checkbox4"></label></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                        <label for="checkbox5">Sân vườn</label></td>
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                        Điều hòa</td>
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                        Sân thượng</td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                            Điện thoại
                                           	<label for="checkbox6"></label></td>
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                        Hồ bơi
                                            <label for="checkbox6"></label></td>
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                            Nhà bếp
                                            <label for="checkbox6"></label></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox7" id="checkbox1" />
                                            Gara ôtô
                                            <label for="checkbox7"></label></td>
                                        <td><input type="checkbox" name="checkbox7" id="checkbox2" />
                                            Phòng khách<label for="checkbox7"></label></td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" bgcolor="#ebf3fb"><span class="private_text_title">Văn hóa - Xã hội</span></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Gần công viên
                                           	<label for="checkbox4"></label></td>
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Gần trung tâm giả trí
                                            <label for="checkbox4"></label></td>
                                        <td><input type="checkbox" name="checkbox4" id="checkbox4" />
                                            Gần trường mẫu giáo
                                            <label for="checkbox4"></label></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                        <label for="checkbox5">Gần trung tâm thương mại</label></td>
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                            Gần trường ĐH-CĐ
                                        </td>
                                        <td><input type="checkbox" name="checkbox5" id="checkbox5" />
                                            Gần bệnh viện
                                        </td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                            Gần trường cấp III
                                           	<label for="checkbox6"></label></td>
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                        Gần chợ
                                            <label for="checkbox6"></label></td>
                                        <td><input type="checkbox" name="checkbox6" id="checkbox6" />
                                            Gần trường cấp II
                                            <label for="checkbox6"></label></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="checkbox" name="checkbox7" id="checkbox3" />
                                            Tiện kinh doanh
                                            <label for="checkbox7"></label></td>
                                        <td><input type="checkbox" name="checkbox7" id="checkbox4" />
                                            Gần trường cấp I<label for="checkbox7"></label></td>
                                        <td><input type="checkbox" name="checkbox7" id="checkbox5" />
                                            Khu dân trí cao<label for="checkbox7"></label></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" bgcolor="#ebf3fb"><span class="private_text_title">Tình trạng pháp lý</span></td>
                                    </tr>
                                    <tr bgcolor="#F7FBFB">
                                        <td><input type="radio" name="Book" id="rbtRedBook" value="RedBook" checked="checked" />
                                        <label for="rbtRedBook">Sổ đỏ</label></td>
                                        <td><input type="radio" name="Book" id="rbtPinkBook" value="PinkBook" />
                                        <label for="rbtPinkBook">Sổ hồng</label></td>
                                        <td><input type="radio" name="Book" id="rbtHandWritingBook" value="HandWritingBook" />
                                        <label for="rbtHandWritingBook">Giấy tay</label></td>
                                    </tr>
                                            
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <input id="checkbox7" type="checkbox" name="checkbox7">
								<span class="private_text_ck">Tôi cam kết nội dung đăng tin hoàn toàn lành mạnh đúng với <a href="#">qui định điều khoản</a> của website hoichomuaban.com.</span>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td align="center"><input type="submit" class="private_bt_submit_news" value="Đăng tin" id="" style="width:90px;"></td>
                        </tr>
                </table>
                <//form>
            </div>
        </div>
        <!-- End Content right -->
    </div>
</asp:Content>
